//
//  HLEEmptyDataView.m
//  HLEEmptyView
//
//  Created by hle1 on 2020/9/12.
//

#import "HLEEmptyDataView.h"
#import <Masonry/Masonry.h>
#import <YsToolsManager/YsToolsManager.h>
#import <YYCategories/YYCategories.h>

@implementation HLEEmptyDataView

+ (instancetype)emptyViewWithImage:(UIImage *)image
                          titleStr:(NSString *)titleStr
{
    HLEEmptyDataView *emptyDataView = [[self alloc] init];
    UIImageView *imageView = [[UIImageView alloc] initWithImage:image];
    [emptyDataView addSubview:imageView];
    
    [imageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(0);
        make.centerX.mas_equalTo(0);
    }];
    
    UILabel *titleLabel = [UILabel creatLabel:titleStr textColor:[UIColor colorWithHexString:@"#999999"] fontSize:[UIFont systemFontOfSize:13] numberofLines:0];
    titleLabel.textAlignment = NSTextAlignmentCenter;
    [emptyDataView addSubview:titleLabel];
    [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(imageView.mas_bottom).offset(19);
        make.bottom.mas_equalTo(0);
        make.centerX.mas_equalTo(0);
        make.left.mas_greaterThanOrEqualTo(30);
        make.right.mas_lessThanOrEqualTo(-30);
    }];
    return emptyDataView;
}


@end
